class Father:
    count = 0
    def __init__(self, name, age,gender):
        self.name = name
        self.age = age
        self.__gender = gender
        Father.count += 1

    def eat(self):
        print('father is eating')

    def sleep(self):
        print('father is sleepping')

    @classmethod
    def show_person_size(cls):
        print(f'当前类{cls}共有{cls.count}实例对象')

    @staticmethod
    def menu():
        print('1、开始')
        print('2、过程')
        print('3、结束')

class Son(Father):
    def __init__(self,name,age,gender,action):
        super().__init__(name,age,gender)
        self.action = action

    def eat(self):
        print('son is eating')

    def sleep(self):
        print('son is sleepping')

    @classmethod
    def show_person_size(cls):
        print(f'当前类{cls}共有{cls.count}实例对象')

    @staticmethod
    def menu():
        print('4、开始')
        print('5、过程')
        print('6、结束')

class GrandSon(Son):
    pass

grandSon = GrandSon('儿子',20,'女','跑步')
GrandSon.show_person_size()
GrandSon.menu()
print('-'*20)
grandSon.eat()
grandSon.sleep()
grandSon.show_person_size()
grandSon.menu()

# father = Father('爸爸',40,'男')
# son = Son('儿子',20,'女','跑步')
# Father.show_person_size()
# Father.menu()
# print('-'*20)
# father.eat()
# father.sleep()
# father.show_person_size()
# father.menu()
# print('-'*20)
# Son.show_person_size()
# Son.menu()
# print('-'*20)
# son.eat()
# son.sleep()
# son.show_person_size()
# son.menu()
# print('-'*20)
#
# print(Father.count)